/*
 * @Description:
 * @Author: 仲灏<izhaong 164165005@qq.com>
 * @Date: 2021-05-14 14:58:18
 * @LastEditors: 仲灏<izhaong 164165005@qq.com>
 * @LastEditTime: 2021-05-20 16:54:12
 */
const { app, BrowserWindow, Menu } = require("electron");
const path = require("path");

function createWindow() {
  const mainWindow = new BrowserWindow({
    fullscreen: true,
    titleBarStyle: 'hidden',
    frame: false,
    useContentSize: true,
    menuBarVisible: false,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      enableRemoteModule: true,
    },
  });

  mainWindow.loadFile("index.html");
  mainWindow.menuBarVisible();
}

app.whenReady().then(() => {
  createWindow();
  
  app.on("activate", function () {
    if (BrowserWindow.getAllWindows().length === 0) createWindow();
    Menu.setApplicationMenu(null);
  });
});

app.on("window-all-closed", function () {
  if (process.platform !== "darwin") app.quit();
});
